package com.example.lianjuan.Utils;

import android.content.Context;
import android.content.Intent;

import com.example.lianjuan.Base.IBaseInfo;
import com.example.lianjuan.Presenter.impl.impl.TicketPresenterImpl;
import com.example.lianjuan.ui.activeity.TicketActivity;

/**
 * 跳转领优惠价activity工具类
 *
 * @author 81067
 */
public class TicketUtil {
    public static void toTickerPager(Context context, IBaseInfo baseInfo) {
        //先获取到ticketPresenter的对象,在继续跳转加载
        TicketPresenterImpl ticketPresenter = PresenterManang.getInstance().getTicketPresenter();
        //商品标签
        String title = baseInfo.getTitle();
        //商品图片
        String cover = baseInfo.getPicUrl();
        //有无优惠卷
        String url = baseInfo.getCouponUrl();
        if (url == null) {
            url = baseInfo.getUrl();
        }
        Intent intent = new Intent(context, TicketActivity.class);
        ticketPresenter.getTicket(title, url, cover);
        context.startActivity(intent);
    }
}
